<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta http-equiv="pragma" content="no-cache">  
	<meta http-equiv="cache-control" content="no-cache">  
	<meta http-equiv="expires" content="0"> 
    <title>大棚鱼塘列表</title>
    <script src="dist/js/jquery-1.9.1.min.js"></script> 
    <link rel="stylesheet" href="dist/css/animate.css" >
    <link rel="stylesheet" href="dist/css/normalize.css">
    <link rel="stylesheet" href="dist/css/bootstrap.css">
    <link rel="stylesheet" href="dist/css/index_public.css">
    <link rel="stylesheet" href="dist/css/sweetalert.css">
    <script src="dist/js/widgets/sweetalert.min.js"></script>
    <script src="dist/js/js/index_head_left.js"></script>
    <script src="dist/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="dist/css/toastr.min.css" >
	<script src="dist/js/widgets/toastr.min.js"></script>
	<script type="text/javascript" src="dist/js/widgets/jquery.nicescroll.min.js"></script>
	<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=sjnEPnWsuqC8nnOea4HMNQkUqK3TGBmu"></script>
	<style>
		.Bgbox{float:left;margin:10px;background-color:#FFFFFF;width:500px;padding:0px 20px}
		.smBox{justify-content:space-between;display: flex;} .lf{float:left} .rt{float:right}
		.specialLabel{float:right;max-width:130px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
		.line{background-color:#CCCCCC;width:1px;height:150px;}
		.cb{color:#2CB184;font-size:16px;margin-top:10px;}
		.barCb{background-color:#2CB184} .barDd{background-color:#D2D3D3} 
        .hightest{height:60px;} .midHt{height:40px;} .minHt{height:10px;}
	</style>
    <script>
        $(document).ready(function(){
            $("#div1").load('include/left_title.html',function(){menu();})
            $("#loadHeader").load("include/header.html",function(){header();})
            $("#personal").load("include/modelpersonal.html",function(){personalModel();})
			getGroundFishInfo();
        });
		function getGroundFishInfo(){
			$.ajax({
				type:"POST",
	 			url:"actionServlet",
	 			data:{"actionName":"webService","method":"getGroundFishpondListById","page":"0","pageSize":"100"},
	 			dataType:"JSON",
	 			success:function(data){
	 				if(data.statusCode == 100){toastr.error('请联系管理员','未拥有权限');return;}
	 				var result=data.result;
	 				var html='';
	 				for(var i=0;i<result.length;i++){
	 					html+='<div class="Bgbox"><h3 data-id="'+result[i].number+'" class="hoverColor listTitle">';
	 					 if(result[i].type=='0'){html+=result[i].number+'号大棚</h3>';}
	 					 else{html+=result[i].number+'号鱼塘</h3>';}
	 					 html+='<div class="smBox"><table style="width:240px;"><tbody><tr><td><label class="numericalFont lf">下属组织</label>'+
	 					 '<label class="numericalFont rt">'+result[i].cropCnt+'</label></td></tr>';
	 					 if(result[i].crop==null){html+='<tr><td><label class="numericalFont lf">作物</label> <label class="specialLabel">无作物</label></td></tr>';}
	 					 else{ html+='<tr><td><label class="numericalFont lf">作物</label> <label class="specialLabel">'+result[i].crop+'</label></td></tr>';}
	 					html+='<tr><td><label class="numericalFont lf">设备数量</label><label class="numericalFont rt">'+result[i].deviceCnt+'</label></td></tr>'+
	 					' <tr><td><label class="numericalFont lf">断线</label><label class="numericalFont rt"> '+result[i].offlineCnt+'</label></td></tr>'+
	 					'<tr><td><label class="numericalFont lf">预警</label><label class="numericalFont rt">'+result[i].warningCnt+'</label> </td></tr>'+
	 					 '<tr><td><label class="numericalFont lf">正在运行</label><label class="numericalFont rt">'+result[i].runingCnt+'</label></td></tr></tbody></table>'+
	 					 '<div class="line"></div>'+
	 					 ' <div style="text-align:center;"><label class="numericalFont">年度积溫</label><br>';
	 					 if(result[i].temperature.length>5){
	 						var a=result[i].temperature.slice(0,2);
	 						html+='<label class="cb" title="'+result[i].temperature+'℃">'+a+'...℃</label>'
	 					 }else{html+='<label  class="cb" title="'+result[i].temperature+'">'+result[i].temperature+'℃</label>'}
	 					 html+='<table style="margin-top:10px;height:100px"><tbody>';
	 					 html+='<tr style="vertical-align:bottom;height:60px"><td style="width:30px;">';
	 					 var temVal=result[i].temperature;var temPreVal=result[i].temperaturePre;
	 					 if(temVal=='0.00'&& temPreVal!='0.00'){
	 						html+='<div class="barCb minHt" title="'+result[i].temperature+'℃"></div></td>'+
	 						 '<td style="width:10px"></td><td style="width:30px;"><div class="barDd hightest"  title="'+result[i].temperaturePre+'℃"></div></td></tr>';
	 					 }else if(temPreVal=='0.00'&&temVal!='0.00'){
	 						html+='<div class="barCb hightest" title="'+result[i].temperature+'℃"></div></td>'+
	 						 '<td style="width:10px"></td><td style="width:30px;"><div class="barDd minHt" title="'+result[i].temperaturePre+'℃"></div></td></tr>';
	 					 }else if(temPreVal=='0.00'&&temVal=='0.00'){
	 						html+='<div class="barCb minHt" title="'+result[i].temperature+'℃"></div></td>'+
	 						 '<td style="width:10px"></td><td style="width:30px;"><div class="barDd minHt" title="'+result[i].temperaturePre+'℃"></div></td></tr>';
	 					 }else if(parseInt(temVal)>parseInt(temPreVal)){
	 						html+='<div class="barCb hightest" title="'+result[i].temperature+'℃"></div></td>'+
	 						 '<td style="width:10px"></td><td style="width:30px;"><div class="barDd midHt" title="'+result[i].temperaturePre+'℃"></div></td></tr>';
	 					 }else if(parseInt(temVal)<parseInt(temPreVal)){
	 						html+='<div class="barCb midHt" title="'+result[i].temperature+'℃"></div></td>'+
	 						 '<td style="width:10px"></td><td style="width:30px;"><div class="barDd hightest" title="'+result[i].temperaturePre+'℃"></div></td></tr>';
	 					 }else{
	 						html+='<div class="barCb hightest" title="'+result[i].temperature+'℃"></div></td>'+
	 						 '<td style="width:10px"></td><td style="width:30px;"><div class="barDd hightest" title="'+result[i].temperaturePre+'℃"></div></td></tr>';
	 					 }
	 					 html+='<tr><td>2018</td><td style="width:10px;"></td><td>2017</td></tr></tbody></table></div><div class="line"></div>'+
	 					 '<div style="text-align:center;"><label class="numericalFont">年度光照</label><br>';
	 					 if(result[i].light.length>5){
	 						var b=result[i].light.slice(0,2);
	 						 html+='<label class="yincangkuandu cb" title="'+result[i].light+'小时">'+b+'..小时</label>'
	 					 }else { html+='<label class="yincangkuandu cb" title="'+result[i].light+'小时">'+result[i].light+'小时</label>'}
	 					 html+=' <table style="margin-top:10px;height:100px"><tbody> <tr style="vertical-align:bottom;height:60px">';
	 					 if(result[i].light=='0.00'&&result[i].lightPre!='0.00'){
	 						 html+=' <td style="width:30px;"><div class="barCb minHt" title="'+result[i].light+'小时"></div></td><td style="width:10px;"></td>'+
                                 '<td style="width:30px;"><div class="barDd hightest" title="'+result[i].lightPre+'小时"></div></td></tr>'
	 					 }else if(result[i].lightPre=='0.00'&&result[i].light!='0.00'){
	 						 html+=' <td style="width:30px;"><div class="barCb hightest" title="'+result[i].light+'小时"></div></td><td style="width:10px;"></td>'+
                             '<td style="width:30px;"><div class="barDd minHt" title="'+result[i].lightPre+'小时"></div></td></tr>'
	 					 }else if(result[i].lightPre=='0.00'&&result[i].light=='0.00'){
	 						 html+=' <td style="width:30px;"><div class="barCb minHt" title="'+result[i].light+'小时"></div></td><td style="width:10px;"></td>'+
                             '<td style="width:30px;"><div class="barDd minHt" title="'+result[i].lightPre+'小时"></div></td></tr>'
	 					 }
	 					 else if(parseInt(result[i].light)>parseInt(result[i].lightPre)){
	 						 html+=' <td style="width:30px;"><div class="barCb hightest" title="'+result[i].light+'小时"></div></td><td style="width:10px;"></td>'+
                             '<td style="width:30px;"><div class="barDd midHt" title="'+result[i].lightPre+'小时"></div></td></tr>'
	 					 }else if(parseInt(result[i].light)<parseInt(result[i].lightPre)){
	 						 html+=' <td style="width:30px;"><div class="barCb midHt" title="'+result[i].light+'小时"></div></td><td style="width:10px;"></td>'+
                             '<td style="width:30px;"><div class="barDd hightest" title="'+result[i].lightPre+'小时"></div></td></tr>'
	 					 }else{
	 						 html+=' <td style="width:30px;"><div class="barCb hightest" title="'+result[i].light+'小时"></div></td><td style="width:10px;"></td>'+
                             '<td style="width:30px;"><div class="barDd hightest" title="'+result[i].lightPre+'小时"></div></td></tr>'
	 					 }
	 					 html+='<tr><td>2018</td><td style="width:10px;"></td><td>2017</td></tr></tbody></table></div></div></div>';
	 				}
	 				$("#ground_fish_div").append(html);
	 			}
			})
		}
    </script>
</head>
<style>
</style>
<body>
 <div class="container-fluid">
     <!-- header  -->
    <div class="nav row " id="loadHeader">
    </div>
    <div class="row neirong" >
        <!-- 侧边导航 -->
        <div id="div1" class="sidebar col-xs-2">
        </div>
        <div class="modal fade" id="personal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">  
 		</div> 
        <!-- 主题内容 -->
        <div class="main col-xs-10 row animated fadeInRight" style="background:#F4F7FE;overflow-x:auto;">
			<div id="ground_fish_div" class="col-xs-12 " style="height:100%;min-height:600px;min-width:1100px;background-color:#F4F7FE;margin:0 auto;">
				<h2 id="title_company_name" class="col-xs-12" style="font-size:20px;text-align:center;font-family:'黑体'"></h2>
			</div>        
        </div>
    </div>
  <div class="row" id="divFooter"></div> 
 </div>
  <script>
  $(function(){
	  $("#ground_fish_div").on('click','.listTitle',function(){
			var id=$(this).attr('data-id');
			$.ajax({
	 			type:"POST",
	 			url:"actionServlet",
	 			data:{"actionName":"webService","method":"toDevicePage","gfNum":id},
	 			dataType:"JSON",
	 			success:function(data){
	 				if(data.statusCode == 100){
		 				toastr.error('请联系管理员','未拥有权限');
		 				return;
		 			}
	 				window.location.href="actionServlet?actionName=webService&method=toPage&page=deviceManage";
	 			}
	 		});
	 })
  })
  </script>
</body>
</html>